<template>
  <div class="piece">
    <div style="font-size:70px">{{ type }}</div>
    <div class="number" v-if="count > 1">x{{ count }}</div>
    <div v-if="state == 2" class="options">
      <div class="option">移动</div>
      <div class="option">攻击</div>
      <div class="option">强化</div>
      <div class="option">占领</div>
      <div class="option">战术</div>
      <div class="option option-cancel">取消</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    type: Number,
    count: Number
  },
  data() {
    return {
      state: 1
    }
  }
}
</script>

<style scoped>
.piece {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 10px solid black;
}

.number {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid red;
  background-color: white;
  color: red;
  font-size: 25px;
  font-weight: bold;
  text-align: center;
  line-height: 40px;
}

.options {
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -8px;
  top: -8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.option {
  padding: 5px;
  border: 2px solid black;
  border-radius: 5px;
  background-color: white;
}

.option:hover {
  background-color: #cccccc;
}

.option-cancel {
  color: red;
}
</style>
